import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)

export default new Router({
	// mode: "history",
	scrollBehavior(to, from, savedPosition) {
		// 对于所有路由导航，简单地让页面滚动到顶部
		return {
			x: 0,
			y: 0
		}
	},
	routes: [{
			path: '/',
			redirect: '/admin/login',
			meta: {
				title: '登录'
			}
		},
		{
			path: '/admin/login',
			meta: {
				title: '管理后台'
			},
			component: resolve => require(['./../components/login'], resolve)
		},
		{
			path: '/admin/header',
			component: resolve => require(['./../components/header/header'], resolve),
			children: [{
				path: 'admin/mainstay',
				component: resolve => require(['./../components/nav/nav'], resolve),
				children: [{
						path: '/admin/mainstay/home',
						meta: {
							title: '首页'
						},
						component: resolve => require(['./../components/mainstay/home'], resolve)
					},
					{
						path: '/admin/mainstay/caseAdmin',
						meta: {
							title: '案例管理'
						},
						component: resolve => require(['./../components/mainstay/caseAdmin'], resolve)
					},
					{
						path: '/admin/mainstay/hotelAdmin',
						meta: {
							title: '酒店管理'
						},
						component: resolve => require(['./../components/mainstay/hotelAdmin'], resolve)
					},
					{
						path: '/admin/mainstay/order',
						meta: {
							title: '预约'
						},
						component: resolve => require(['./../components/mainstay/order'], resolve)
					},
					{
						path: '/admin/mainstay/company',
						meta: {
							title: '公司资料'
						},
						component: resolve => require(['./../components/mainstay/company'], resolve)
					},
					{
						path: '/admin/mainstay/client',
						meta: {
							title: '客户管理'
						},
						component: resolve => require(['./../components/mainstay/client'], resolve)
					},
					{
						path: '/admin/mainstay/weddingCase',
						meta: {
							title: '婚礼案例'
						},
						component: resolve => require(['./../components/mainstay/weddingCase'], resolve)
					},
					{
						path: '/admin/mainstay/childrenCase',
						meta: {
							title: '儿童案例'
						},
						component: resolve => require(['./../components/mainstay/childrenCase'], resolve)
					},
					{
						path: '/admin/mainstay/editWedding',
						meta: {
							title: '编辑婚礼案例'
						},
						component: resolve => require(['./../components/mainstay/editWedding'], resolve)
					},
					{
						path: '/admin/mainstay/editTravel',
						name: 'editTravel',
						meta: {
							title: '编辑旅拍案例'
						},
						component: resolve => require(['./../components/mainstay/editTravel'], resolve)
					},
					{
						path: '/admin/mainstay/editHotel',
						meta: {
							title: '编辑酒店案例'
						},
						component: resolve => require(['./../components/mainstay/editHotel'], resolve)
					},
					{
						path: '/admin/mainstay/editChildren',
						meta: {
							title: '编辑儿童案例'
						},
						component: resolve => require(['./../components/mainstay/editChildren'], resolve)
					},
					{
						path: '/admin/mainstay/addLive',
						meta: {
							title: '添加直播'
						},
						component: resolve => require(['./../components/mainstay/addLive'], resolve)
					},
					{
						path: '/admin/mainstay/addAlbum',
						meta: {
							title: '添加相册'
						},
						component: resolve => require(['./../components/mainstay/addAlbum'], resolve)
					},
					{
						path: '/admin/mainstay/changePwd',
						meta: {
							title: '修改密码'
						},
						component: resolve => require(['./../components/mainstay/changePwd'], resolve)
					},
					{
						path: '/admin/mainstay/addvideo',
						meta: {
							title: '编辑直播'
						},
						component: resolve => require(['./../components/mainstay/addvideo'], resolve)
					},
					{
						path: '/admin/mainstay/addImg',
						meta: {
							title: '添加相册'
						},
						component: resolve => require(['./../components/mainstay/addImg'], resolve)
					},
          {
          	path: '/admin/mainstay/selectImg',
          	meta: {
          		title: '图片管理'
          	},
          	component: resolve => require(['./../components/mainstay/selectImg'], resolve)
          },
           {
          	path: '/admin/mainstay/imgList',
          	meta: {
          		title: '图片清单'
          	},
          	component: resolve => require(['./../components/mainstay/imgList'], resolve)
          }
				]
			}]
		}
	]
})
